home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Extravaganza - Disc 4
/
Shareware Extravaganza - Over 25,000 Programs (The Ultimate Shareware Company)(Disc 4 of 4)(1993).iso
/
cad
/
lcad35.zip
/
LC.LSP
< prev
next >
Wrap
Lisp/Scheme
|
1991-02-14
|
3KB
|
97 lines
; LaunchCAD Autolisp program version 3.5
; Note: add the line: (load"lc") to the end of your ACAD.LSP file.
; If you do not have an ACAD.LSP file then you can rename this file to ACAD.LSP
; or add the contents of this file to your present ACAD.LSP file.
(princ "\nLoading LaunchCAD...")
(if(< (substr(getvar "ACADVER")1 2) "11")
(setvar "MENUECHO" 1)) ; this makes INSERT work right
(defun lc_shell (mode dt / ce me dir f) ; call LaunchCAD in shell mode
(setq ce (getvar "CMDECHO"))
(setvar "CMDECHO" 0) ; don't echo commands
(setq me (getvar "MENUECHO"))
(setvar "MENUECHO" 1) ; do echo menu commands
(if (= dt "d") (progn
(setq dir (getvar "DWGPREFIX"))
)
(setq dir ".")
)
(if (null dir) (setq dir "."))
; (command "sh" "mode co80") ; decomment for dual screen
(command "launchcad" (strcat dir " " mode)) ; invoke LaunchCAD
; (command "sh" "mode mono") ; decomment for dual screen
; (graphscr) ; " "
(command "script" "lc") ; run the script
(if(setq f(open(findfile "lc.scr")"w")) ; just in case...
(close f)) ; empty script file.
(setvar "CMDECHO" ce) ; restore CMDECHO
(setvar "MENUECHO" me) ; restore MENUECHO
(princ)
)
; Note: You may edit this lisp file to rename the following functions
; to any name that you wish so long as it does not conflict with an
; AutoCAD internal command.
; Execute LaunchCAD from within AutoCAD (in shell mode)
(defun c:lc () (lc_shell "shell" "d"))
(defun c:ins () (lc_shell "insert" "s")) ; Insert Mode
(defun c:lisp () (lc_shell "lisp" "s")) ; Lisp Mode
(defun c:dxf () (lc_shell "dxfin" "s")) ; DXFIN Mode
(defun c:dxb () (lc_shell "dxbin" "s")) ; DXBIN Mode
(defun c:vs () (lc_shell "vslide" "s")) ; VSlide Mode
(defun c:mu () (lc_shell "menu" "s")) ; Menu Mode
(defun fi ()
(command "launchcad" ". file" ) ; invoke LaunchCAD file Mode
(princ)
)
; Redefine the QUIT command to run quit.scr in order to
; bypass the AutoCAD opening menu.
(defun c:quit ()
(setvar "CMDECHO" 0)
(initget "No Yes")
(if(= "Yes" (getkword
"\nDo you really want to discard\nall changes to drawing[y/N]: "))
(command "script" "quit"))
(princ)
)
; Redefine the END command to run end.scr in order to
; bypass the AutoCAD opening menu.
(defun c:end ()
(setvar "CMDECHO" 0)
(command "script" "end") ; run end.scr which bypasses menu
(princ)
)
(defun c:wend ()
(setvar "CMDECHO" 0)
(command "script" "wend") ; run wend.scr which saves drawing
(princ) ; using wblock * and bypasses menu
)
; Undefine the AutoCAD drawing editor END and QUIT commands so that
; the end and quit functions defined above will work in place of the
; internal commands (.end and .quit will still work like normal)
; NOTE: (lc:su) MUST be in STARTUP.LSP or the S::STARTUP function
; in ACAD.LSP
(defun lc:su()
(command "UNDEFINE" "QUIT")
(command "UNDEFINE" "END")
(princ "\nEND and QUIT commands redefined...")
(princ "\nLaunchCAD initialized.")
(princ)
)
(princ "\nLaunchCAD loaded.")
(princ)